//
//  CommentTableViewCell.m
//  Arts1
//
//  Created by Mac Jc on 15/10/4.
//  Copyright © 2015年 Arts1. All rights reserved.
//

#import "CommentTableViewCell.h"
#import "AllHeader.h"


@implementation CommentTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        _iconImage = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, 30, 30)];
        _iconImage.layer.cornerRadius = 15;
        _iconImage.layer.masksToBounds = YES;
        _iconImage.backgroundColor = kRandomColor;
        [_iconImage setContentMode:(UIViewContentModeScaleAspectFill)];
        [self.contentView addSubview:_iconImage];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(55, 13, 100, 12)];
        _nameLabel.font = [UIFont boldSystemFontOfSize:11];
        _nameLabel.textColor = kCustomColor(40, 40, 50, 1);
        [self.contentView addSubview:_nameLabel];
        
        NSDate *senddate=[NSDate date];
        NSDateFormatter  *dateformatter=[[NSDateFormatter alloc] init];
        [dateformatter setDateFormat:@"MM月dd日 HH:mm"];
        NSString *  locationString=[dateformatter stringFromDate:senddate];
        
        _timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH - 100 - 10, 12, 100, 10)];
        _timeLabel.text = locationString;
        _timeLabel.font = [UIFont systemFontOfSize:10];
        [_timeLabel setTextAlignment:(NSTextAlignmentRight)];
        _timeLabel.textColor = kCustomColor(150, 150, 150, 1);
        [self.contentView addSubview:_timeLabel];
        

        
        _commentContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(55, 30, 280, 100)];
        _commentContentLabel.font = [UIFont systemFontOfSize:12];
        [_commentContentLabel setNumberOfLines:0];
        _commentContentLabel.lineBreakMode = NSLineBreakByWordWrapping;
        _commentContentLabel.textColor = kCustomColor(150, 150, 150, 1);
        [self.contentView addSubview:_commentContentLabel];
        


        
    }
    return  self;
}



@end
